
using BookApp.Domain;
using BookApp.Repository;
using Microsoft.EntityFrameworkCore;

var builder = WebApplication.CreateBuilder(args);

var conString = builder.Configuration.GetConnectionString("mysql");
builder.Services.AddDbContext<BookDbContext>(p =>
{
    p.UseMySql(conString, ServerVersion.AutoDetect(conString));
});

builder.Services.AddScoped(typeof(IRepository<>), typeof(EfRepository<>));

builder.Services.AddControllers();

var app = builder.Build();


app.MapControllers();
app.Run();

